/*=============================================================================

  Application UI MODULE

  FILE: appUIvw_eng.cpp
  
  DESCRIPTION

    Application UI Module

  EXTERNALIZED FUNCTIONS


   Copyright (c) DaeSung Engineering Inc. All rights reserved.

=============================================================================*/
/*=============================================================================

  EDIT HISTORY

  ---------  -------  -------------------------------------------------------
    when       who       what, where, why
  ---------  -------  -------------------------------------------------------
   03/14/04   nso4th    Initial version

=============================================================================*/

/*=============================================================================
  HEADER INCLUSION
=============================================================================*/
#include <Cust_AppDef.h>
#include "mainView.h"
#include "dlgDio.h"

/*=============================================================================
  INTERNAL FUNCTION DEFINITION
=============================================================================*/


static mcxt		gDlgDio = NULL;
/*=============================================================================
  EXTERNALIZED FUNCION DEFINITION
=============================================================================*/
void vwDio_Create(boolean enable)
{
	CDlgDio			*dlg;

	if(enable)
	{
		if(gDlgDio != NULL)
			return;

		dlg = new CDlgDio;
		ObjList_Set(VIEW_DIO, (mcxt)dlg/*gDlgDio*/);

		dlg->Create(NULL);
		
		gDlgDio = (mcxt)dlg;
		dlg->UI_Handle((mcxt*)&gDlgDio);
		dlg->ShowWindow(SW_HIDE);
	}
	else
	{
		ObjList_Set(VIEW_DIO, NULL);
		if(gDlgDio == NULL)
		{
			return;
		}
	}
}

void UIvw_Dio(boolean enable)
{
	CMainView		*mv = (CMainView*)ObjList_Get(VIEW_MAIN);
	CDlgDio			*dlg = (CDlgDio*)gDlgDio;
	int32			mode;
	//RECT			rc;

	if(dlg == NULL)
		return;
	
	if(enable)
	{
		//mv->GetWindowRect(&rc);
		mode = SW_NORMAL;
		//dlg->SetWindowPos(NULL, rc.right+UIsize_TBL(UISIZE_MARGIN_X), rc.top-(6*UIsize_TBL(UISIZE_MARGIN_Y)),  0, 0, SWP_NOSIZE);
	}
	else
	{
		mode = SW_HIDE;
	}
	dlg->ShowWindow(mode);
}

boolean UIvw_IsShowDio(void)
{
	CDlgDio			*dlg = (CDlgDio*)gDlgDio;

	if(dlg == NULL)
		return	FALSE;

	return	(boolean)::IsWindowVisible(dlg->m_hWnd);
}

/*--- END OF appUIvw_eng.cpp ---*/
